//日期格式化
export function formatDate(timeStamp, fmt) {
	// 时间戳转换为日期格式
	let date = new Date(parseInt(timeStamp));
	let y = date.getFullYear();
	let m = date.getMonth() + 1;
	m = m < 10 ? ('0' + m) : m;
	let d = date.getDate();
	d = d < 10 ? ('0' + d) : d;
	let h = date.getHours();
	h = h < 10 ? ('0' + h) : h;
	let minute = date.getMinutes();
	let second = date.getSeconds();
	minute = minute < 10 ? ('0' + minute) : minute;
	second = second < 10 ? ('0' + second) : second;
	let dates = fmt.replace('yyyy', y).replace('MM',m).replace('dd',d).replace('hh',h).replace('mm',minute).replace('ss',second)
	return dates
}

function padLeftZero(str) {
	return ('00' + str).substr(str.length)
}
